import cv2

img = cv2.imread('3/lena_color.jpg')
img = cv2.bitwise_not(img)

cv2.imshow('img', img)
cv2.waitKey(0)
cv2.destroyAllWindows()